--[[string.lua
--]]

function string.startwith(value, prefix, toffset)
    if value and prefix then
        toffset = (toffset or 1) > 0 and toffset or 1
        return string.sub(value, toffset, toffset + #prefix - 1) == prefix
    end
    return false
end

function string.endwith(value, suffix)
    if value and suffix then
        return string.sub(value, -#suffix) == suffix
    end
    return false
end
